<template>
  <el-container class="index">
    <el-header>
      <el-row align="middle">
        <el-col :span="4" style="margin-top: 4px; text-align: left">
          <div class="block">
            <el-avatar :size="50">
              <img src="../../static/img/y.jpg" />
            </el-avatar>
            <div id="" style="position: fixed; top: 20px; left: 80px">
              <span style="color: white">admin</span>
            </div>
          </div>
        </el-col>
        <el-col :span="10" style="margin-top: 12px">
          <el-button
            type="primary"
            size="small"
            icon="el-icon-edit"
            @click="updatePwd()"
            round
            >修改密码</el-button
          >
          <el-button type="success" size="small" icon="el-icon-check" round
            >退出系统</el-button
          >
          <el-button type="info" size="small" icon="el-icon-message" round
            >系统首页</el-button
          >
        </el-col>
        <br />

        <el-col :span="10" style="color: white">在线考试系统</el-col>
      </el-row>
    </el-header>

    <el-container>
      <el-aside width="200px">
        <el-menu router="">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-setting"></i><span>系统管理</span>
            </template>
            <el-menu-item-group>
              <!-- index 路由地址 -->
              <el-menu-item index="/index/student">用户管理</el-menu-item>
              <el-menu-item index="1-2">角色管理</el-menu-item>
              <el-menu-item index="1-3">权限管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-user"></i><span>员工管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1">员工管理</el-menu-item>
              <el-menu-item index="2-2">档案管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu> -->

          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-order"></i><span>考试管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/index/exampaper">试卷列表</el-menu-item>
              <el-menu-item index="/index/onexam">在线考试</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-message-solid"></i><span>模拟考试管理</span>
            </template>
            <el-menu-item-group>
            <el-menu-item index="/index/onsample">模拟考试</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="5">
            <template slot="title">
              <i class="el-icon-s-order"></i><span>题库管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/index/question">题库信息</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="6">
            <template slot="title">
              <i class="el-icon-user"></i><span>成绩管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/index/scoreManagerment"
                >成绩明细</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-main>
        <router-view></router-view>
      </el-main>

      <!-- 对话框 -->
      <el-dialog title="修改" :visible="isShow" width="30%" :show-close="false">
        <el-form label-width="110px">
          <el-form-item label="新密码">
            <el-col :span="18">
              <el-input
                placeholder="请输入用户名"
                prefix-icon="el-icon-search"
              ></el-input>
            </el-col>
          </el-form-item>

          <el-form-item label="旧密码">
            <el-col :span="18">
              <el-input placeholder="请输入密码"></el-input>
            </el-col>
          </el-form-item>

          <el-form-item>
            <el-col :span="8"> </el-col>
            <el-col :span="8">
              <el-button
                type="success"
                @click="isShow = false"
                icon="el-icon-check"
                round
                >确认</el-button
              >
            </el-col>
            <el-col :span="8">
              <el-button type="info" @click="isShow = false" round
                >取消</el-button
              >
            </el-col>
          </el-form-item>
        </el-form>
      </el-dialog>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      isShow: false, // 控制对话框是否显示
    };
  },
  methods: {
    updatePwd() {
      var self = this;
      self.isShow = true;
    },
    exit() {
      var self = this;
      self.$router.replace({ name: "login" });
    },
  },
};
</script>

<style>
html,
body {
  margin: 0px;
  height: 100%;
}

.el-header {
  /* background-color: #B3C0D1; */
  color: #333;
  text-align: center;
  /* line-height: 60px; */
}

.el-aside {
  background-color: white;
  color: #333;
  /* text-align: center; */
  /* line-height: 200px; */
  height: 550px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: left;
  /* line-height: 160px; */
  /* height: 100%; */
}

.index {
  background-color: #1c77ac;
  background-image: url(../assets/light.png);
  background-repeat: no-repeat;
  /* //background-position:center top;*/
  overflow: hidden;
}
</style>
